<html xmlns:th="http://www.thymeleaf.org">
<div class="bjui-pageHeader" style="background-color:#fefefe; border-bottom:none;">
    <form data-toggle="ajaxsearch" data-options="{searchDatagrid:$.CurrentNavtab.find('#datagrid-businessWuma-filter')}">
        <div class="bjui-searchBar">
            <label>mac地址：</label>
            <input type="text" name="mac" class="form-control" size="15">
            <label>苹果ID：</label>
            <input type="text" name="appleId" class="form-control" size="15">
            <label>状态</label>
            <select name="state" data-toggle="selectpicker" id="select_businessWuma_state">

            </select>

            <button type="submit" class="btn-green" data-icon="search">搜索</button>
            <button type="reset" class="btn-orange" data-icon="times" onclick="resetAll();">重置</button>

            <div class="bjui-moreSearch" style="top: 27px; display: none;">
            </div>
            <div class="pull-right">
                <div class="btn-group">
                    <button type="button" class="btn-default dropdown-toggle" data-toggle="dropdown"
                            data-icon="reply-all" style="width: 150px;">
                        批量操作
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu right" role="menu">
                        <li><a href="javascript:void(0);" onclick="initImp('impBusinessWumaForm','/admin/wuma/initimp');" >批量导入</a></li>
                        <li><a href="javascript:void(0);" onclick="batchState('/admin/wuma/state','datagrid-businessWuma-filter','1');" >批量勾选可用</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </form>
</div>
<div class="bjui-pageContent">
    <table class="table table-bordered" id="datagrid-businessWuma-filter" data-toggle="datagrid" data-options="{
        height: '100%',
        showToolbar: true,
        toolbarItem: 'refresh,|,add,edit,del',
        dataUrl: '/admin/wuma',
        dataType: 'json',
        jsonPrefix: '',
        editMode: {dialog:{width:'800',height:500,title:'编辑信息',mask:true}},
        editUrl: '/admin/wuma/initpage?req_id={id}',
        delUrl:'/admin/wuma/del',
        delPK:'id',
        delConfirm:true,
        showCheckboxcol: true,
        inlineEditMult:false,
        paging: {pageSize:20},
        linenumberAll: true,
        filterThead:false,
        hScrollbar:true
    }">
        <thead>
        <tr>
            <th data-options="{name:'id',align:'center',width:100,render:showTestButton}">
                下载配置</th>
            <th data-options="{name:'state',align:'center',width:100}">状态</th>
            <th data-options="{name:'mac',align:'center',width:300}">mac地址</th>
            <th data-options="{name:'mlb',align:'center',width:250,finalWidth:250}">mlb</th>
            <th data-options="{name:'serialNum',align:'center',width:300}">系列号</th>
            <th data-options="{name:'boardId',align:'center',width:300,finalWidth:300}">主板号</th>
            <th data-options="{name:'productName',align:'center',width:150,finalWidth:150}">产品名称</th>
            <th data-options="{name:'businessApple',align:'center',width:150,render:showBusinessApple,finalWidth:150}">苹果ID</th>
            <th data-options="{name:'updatedTime',align:'center',width:250,finalWidth:250}">更新时间</th>
        </tr>
        </thead>
    </table>
</div>

<script type="text/javascript">
    select_option('select_businessWuma_state', 'com.imessage.type.BusinessWumaState');
    function showBusinessApple(value,data) {
        if(value==null||value==""){
            return "";
        }
        return value.appleId;
    }

    function showTestButton(value,data) {
        if(value==null||value==""){
            return "";
        }
        var url="/admin/wuma/download?id="+value;
        var html = "<button type=\"button\" class=\"btn-blue\" data-toggle=\"ajaxdownload\" data-options=\"{id:'wumaDownload', url:'"+url+"', title:'详情'}\">下载配置</button>";
        return html;
    }
</script>